From 4213a82e5bce7b27e51d065864bfd5d0d90005dc Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Wed, 7 Dec 2005 16:25:13 +0000 Subject: [PATCH] Use xm create's --dryrun option to get the name from the configuration file, rather than the eversoskanky approach taken previously (use grep, and replace any occurrences of %d with [0-9]* !) Signed-off-by: Ewan Mellor --- tools/examples/init.d/xendomains | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/examples/init.d/xendomains b/tools/examples/init.d/xendomains index 23d53efea4..3e8155fcd9 100644 --- a/tools/examples/init.d/xendomains +++ b/tools/examples/init.d/xendomains @@ -152,7 +152,8 @@ contains_something() # read name from xen config file rdname() { - NM=`grep '^name *=' $1 | sed -e 's/^name *= *"\([^"]*\)".*$/\1/' -e 's/%[id]/[0-9]*/g'` + NM=$(xm create --quiet --dryrun --defconfig "$1" | + sed -n 's/^.*(name \(.*\))$/\1/p') } rdnames() @@ -220,6 +221,7 @@ start() rm $dom fi done + echo . fi if contains_something "$XENDOMAINS_AUTO" -- 2.30.2